SELECT FORMMAIN_1708."ID",ORG_MEMBER.CODE usercode,"TO_CHAR"(FORMMAIN_1708.FIELD0024,'yyyy-mm-dd') glbdef8,
CASE WHEN FORMMAIN_1708.FIELD0011 IS NULL THEN 0 ELSE FORMMAIN_1708.FIELD0011 END glbdef2,
CASE WHEN FORMMAIN_1708.FIELD0015 IS NULL THEN 0 ELSE FORMMAIN_1708.FIELD0015 END glbdef3,
CASE WHEN FORMMAIN_1708.FIELD0013 IS NULL THEN 0 ELSE FORMMAIN_1708.FIELD0013 END glbdef4,
CASE WHEN FORMMAIN_1708.FIELD0016 IS NULL THEN 0 ELSE FORMMAIN_1708.FIELD0016 END glbdef5, 
FORMMAIN_1708.FIELD0017 glbdef6,CTP_ENUM_ITEM.SHOWVALUE glbdef7
FROM COL_SUMMARY
LEFT JOIN FORMMAIN_1708 ON FORMMAIN_1708."ID" = COL_SUMMARY.FORM_RECORDID
LEFT JOIN ORG_MEMBER ON ORG_MEMBER."ID" = FORMMAIN_1708.FIELD0001
LEFT JOIN CTP_ENUM_ITEM ON CTP_ENUM_ITEM."ID" = FORMMAIN_1708.FIELD0025
WHERE COL_SUMMARY."ID" = '${id}'